package com.element.security.single.model;

import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Data
public class AuthUserE implements UserDetails, Serializable {

    private static final long serialVersionUID = 1L;
    private String userId;
    private String password;
    private long expires = 7200L;
    private Map<String, Object> expMap = new HashMap<>();
    private List<GrantedAuthority> authorities = new ArrayList<>();

    public String getUsername() {
        return this.userId;
    }

    public boolean isAccountNonExpired() {
        return true;
    }

    public boolean isAccountNonLocked() {
        return true;
    }

    public boolean isCredentialsNonExpired() {
        return true;
    }

    public boolean isEnabled() {
        return true;
    }
}